package com.yunyike.app.component; 

import com.rop.security.AppSecretManager;

import java.util.HashMap;
import java.util.Map;

public class SampleAppSecretManager implements AppSecretManager {

    private static Map<String, String> appKeySecretMap = new HashMap<String, String>();

    static {
    	//自用
        appKeySecretMap.put("100001", "a4160d00-b083-40f9-a749-07aef8781d52");
        appKeySecretMap.put("200001", "f7140046-c46f-443d-a151-00e3b8bb5924");
    }


    public String getSecret(String appKey) {
        System.out.println("use SampleAppSecretManager!");
        return appKeySecretMap.get(appKey);
    }


    public boolean isValidAppKey(String appKey) {
        return getSecret(appKey) != null;
    }
}

